/**
 * @file contests/cf1708/c/main.cpp
 * @brief
 * @see
 * @author Ruiming Guo (guoruiming@stu.scu.edu.cn)
 * @copyright 2022
 * @date 2022/7/17 11:36:59
 **/

#include <bits/stdc++.h>
using namespace std;
const int N = 100010;
int a[N], b[N];
void solve() {
  int n, iq;
  cin >> n >> iq;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int sum = 0, nq = 0;
  for (int i = n; i >= 1; --i) {
    if (a[i] <= nq)
      b[i] = 1;
    else if (nq < iq)
      ++nq, b[i] = 1;
    else
      b[i] = 0;
  }
  for (int i = 1; i <= n; ++i) cout << b[i];
  cout.put('\n');
}
int main() {
  // High rating and good luck!
  int tc;
  cin >> tc;
  while (tc--) {
    solve();
  }
  return 0;
}
